import Home from '../Page/Home'
import List from '../Page/List'
import My from '../Page/My'
import MainLayout from '../Page/MainLayout'
import Chat from '../Page/Chat'
import NoFound from '../Page/Nofound'
import { createBrowserRouter } from 'react-router-dom'
export const routes=createBrowserRouter([
    {
        path:'/',
        async lazy () {
            const {default:MainLayout}=await import('../Page/MainLayout')
            return {element:<MainLayout/>}
        },
        children:[
            {
                path:'/',
                async lazy () {
                    const {default:Home}=await import('../Page/Home')
                    return {element:<Home/>}
                }
            },
            {
                path:'/list',
                async lazy () {
                    const {default:List}=await import('../Page/List')
                    return {element:<List/>}
                }
            },
            {
                path:'/my',
                async lazy () {
                    const {default:My}=await import('../Page/My')
                    return {element:<My/>}
                }
            },
            {
                path:'/chat',
                async lazy () {
                    const {default:Chat}=await import('../Page/Chat')
                    return {element:<Chat/>}
                }

            }
        ]
    },
    {
        path:'*',
        async lazy () {
            const {default:NoFound}=await import('../Page/Nofound')
            return {element:<NoFound/>}

        }
    }
])